package iso3.pt.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import iso3.pt.model.*;
import iso3.pt.service.PtDaoService;
import iso3.pt.service.PtService;

import java.util.Map;
import java.util.Set;


/*
 * EN DESARROLLO
 * 
 * @author ander
 */
public class LoadLecturer  extends ActionSupport
{
	private static final long serialVersionUID = 1L;

	// Datos preparados para que los lea el JSP
	private Profesor profesor = null;
	private Set<Asignatura> lecturerSubjects = null;

	
	public String execute() throws Exception
	{
		@SuppressWarnings("rawtypes")
		Map session = ActionContext.getContext().getSession();
		profesor = (Profesor) session.get("profesor");
		
		PtService service = new PtDaoService();
		lecturerSubjects = (Set<Asignatura>) service.getAsignaturasProfesor(profesor.getId());

		return SUCCESS;
	}

	public Profesor getProfesor()
	{
		return profesor;
	}

	public void setProfesor(Profesor profesor)
	{
		this.profesor = profesor;
	}

	public Set<Asignatura> getLecturerSubjects()
	{
		return lecturerSubjects;
	}

	public void setLecturerSubjects(Set<Asignatura> lecturerSubjects)
	{
		this.lecturerSubjects = lecturerSubjects;
	}
	
	
}